#!/bin/bash

# 定义路径
base_path=$(cd `dirname $0`; pwd) # 当前目录

ZIP_ERROR_FILE="./log/zip_error.log"
RAR_ERROR_FILE="./log/rar_error.log"

IFS=$'\n'
cd ${base_path} # 进入当前目录

cat ${ZIP_ERROR_FILE} | while read line
do
    log_zip=`echo ${line} | awk '{ printf $1}'`

    if [ ! -e ${log_zip}]; then
        echo ${log_zip} | tee -a zip_not_find.log
    else
        echo ${log_zip} | tee -a zip_find.log
    fi
done


cat ${RAR_ERROR_FILE} | while read line
do
    log_rar=`echo ${line} | awk '{ printf $1}'`

    if [ ! -e ${log_rar}]; then
        echo ${log_rar} | tee -a rar_not_find.log
    else
        echo ${log_rar} | tee -a rar_find.log
    fi
done